In a conventional semiconductor memory, a storage element, a select element, and an information extracting wiring are formed in each memory cell. In recent years, a memory of a shift register type has been suggested to realize a memory having a larger capacity. Such a memory is based on a concept that only storage elements are arranged at a high density, and implements a method of transferring stored information to the position of a sensor and a wiring formed in a predetermined site. With the concept and method, there is a possibility that the memory capacity can be dramatically increased. In a shift register for a memory, it is not preferable to add a function for transfer to each bit (each digit) when stored information is to be transferred. Therefore, a shift operation involving a desired number of digits needs to be performed by collectively adding a function to the entire bit string. However, it is not easy to accurately shift the information in all the digits.